const Mock = require('mockjs')
const List = []
const count = 6
for (let i = 0; i < count; i++) {
  List.push(Mock.mock({
    name: '背包',
    id: '@increment',
    num: '@integer(20201314001, 20201314099)',
    'Account|1': ['test'],
    'state|1': ['已关闭',
      '待发货',
      '已发货'
    ],
    'imgUrl|1': ['https://img.alicdn.com/imgextra/i3/1576360184/O1CN01MpJiph1DEJaes3XTj_!!0-saturn_solar.jpg_468x468q75.jpg_.webp',
      'https://img.alicdn.com/imgextra/i1/119145012/O1CN01j7fYT91mtXjyw1sb2_!!0-saturn_solar.jpg_468x468q75.jpg_.webp',
      'https://img.alicdn.com/imgextra/i2/29758262/O1CN019wvUU22Au2y2ytnff_!!0-saturn_solar.jpg_468x468q75.jpg_.webp',
      'https://img.alicdn.com/imgextra/i4/31877853/O1CN01JWUeWF27sj0kw5Wgf_!!0-saturn_solar.jpg_468x468q75.jpg_.webp',
      'https://img.alicdn.com/imgextra/i1/32151104/O1CN01BUTs2T1K1fwZVrKG7_!!0-saturn_solar.jpg_468x468q75.jpg_.webp',
      'https://img.alicdn.com/imgextra/i4/781660031/O1CN01N10Khp1C6EtboG8qq_!!0-saturn_solar.jpg_468x468q75.jpg_.webp'
    ],
    graduate_time: '@datetime',
    price: '￥@integer(100, 150)',
    'pay|1': ['未支付', '微信', '支付宝'],
    source: 'App订单',

    number: '@integer(1, 10)',
    numberOrder: 'R@integer(20011024,20011050)',
    address: 'A市快乐小镇',
    bute: '轻松背包！'
  }))
}
module.exports = [{
  url: '/vue-admin-template/shopping/list',
  type: 'get',
  response: config => {
    const { page = 1, limit = 20 } = config.query
    const pageList = List.filter((item, index) => index < limit * page && index >= limit * (page - 1))
    return {
      code: 20000,
      data: {
        total: List.length,
        items: pageList
      }
    }
  }
},
]
